export function lookInfoPrintData(printSetList, lookInfoList) {
  let data = {}
  lookInfoList.forEach((item, index) => {
    data[item.tem_content.department_id] = { label_info: [], creator: null }
    if (item.tem_content && item.tem_content.label_info) {
      data[item.tem_content.department_id].label_info = item.tem_content.label_info
      data[item.tem_content.department_id].creator = {
        created_at: item.commit_time || '',
        creator_id: item.commit_user_id || '',
        creator_name: item.commit_user_name || '',
      }
    }
  })

  console.log(data);
  printSetList.forEach((item, index) => {
    item.print_list = [] //用于存放该部门需要打印的值
    item.creator = null //存放创建人相关信息
    let departmentId = item.departments.department_id
    if (data[departmentId]) {
      item.creator = data[departmentId].creator
      let list = data[departmentId].label_info
      item.print_field.forEach(str => {
        let index = list.findIndex(a => a.label_key == str)
        if (index != -1) {
          item.print_list.push(list[index])
        }
      })
    }
  })
  return printSetList
}

